<?xml version="1.0" encoding="UTF-8"?>
<%@page import="com.ksyzt.ksite2.server.common.Application"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObj"%>
<%@page import="java.sql.SQLException"%>
<%@page
	import="com.ksyzt.ksite2.server.database.dao.impl.VW_NEWSDAOImpl"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.IVW_NEWSDAO"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObjs"%>
<slider> <%
 	VW_NEWSObjs ns = new VW_NEWSObjs();
 	IVW_NEWSDAO dao = new VW_NEWSDAOImpl(Application.getConnection());
 	try {

 		ns = dao.getSpecificRecordByWhereTemplate(
 				"where oid=? and display>0 and (icon is not null) and length(icon)>0  order by addtime desc",
 				0, 5, 18);
 	} catch (SQLException e) {
 		e.printStackTrace();
 	}
 	for (VW_NEWSObj n : ns) {
 		String href = "";
 		String title = "";
 		String imageUrl = "";
 		href = n.getLINK();
 		if (href == null || href.length() == 0) {
 			href = "news/article.jsp?id=" + n.getID();
 		}
 		boolean useThumbnail = false;
 		imageUrl = n.getICON();
 		if (useThumbnail == true) {
 			if (imageUrl != null && imageUrl.length() > 0) {
 				imageUrl = imageUrl.substring(0,
 						imageUrl.lastIndexOf("."))
 						+ "_s.jpg";
 			}
 		}
 		title = n.getTITLE();
 		out.print("<item href=\"" + href + "\" title=\"" + title
 				+ "\" imageurl=\"" + imageUrl + "\" />");
 	}
 %>  </slider>